
//充值部分
function getczdata(page){
    var loadi = layer.load('加载中…');
    $.ajax({
        type : "get",
        url : "/?s=Home/User/getchongzhidata/page/"+page,
        async : false,
        success : function(data){
            layer.close(loadi);
            var dataObj=eval("("+data+")");//转换为json对象
            var datalen=dataObj.data.length;
            var pagelen=dataObj.page.length;
            var i;
            var str='';
            var pagebody='';
            for(i=0;i<datalen;i++){
                str+='<tr id="del'+dataObj.data[i]['id']+'"><td class="chkTit">'+dataObj.data[i]['orderno']+'</td><td>'+
                    dataObj.data[i]['goldnum']+'</td><td>'+dataObj.data[i]['addtime']+'</td><td id="status'+dataObj.data[i]['id']+'">';

                if(dataObj.data[i]['status']=='0'){
                    str+='转账成功后1分钟内自动到账(<a href="javascript:void(0)"  onclick="czstatus('+dataObj.data[i]['id']+')"></a>)';
                }else if(dataObj.data[i]['status']=='-1'){
                    str+='<font color="red">等待网站管理员审核</font>';
                }else if(dataObj.data[i]['status']=='1'){
                    str+='<font color="green"><strong>充值成功</strong></font>';
                }
                str+='</td><td>'
                if(dataObj.data[i]['status']=='1')
                    str+='无';
                else
                    str+='<a href="javascript:void(0)" onclick="czapplyback('+dataObj.data[i]['id']+')">取消</a>';
                str+='</td></tr>';

            }

            //翻页部分
            pagebody+='<div class="pagination"><ul id="yw0" class="yiiPager">' +
                '<li class="first disabled"><a href="javascript:void(0)" onclick="getczdata(\'1\')">&lt;&lt; 首页</a></li>';

            for(i=0;i<pagelen;i++){
                pagebody+='<li class="previous"><a href="javascript:void(0)" onclick="getczdata(\''+(i+1)+'\')">'+dataObj.page[i]+'</a></li>';
            }

            pagebody+='<li class="last"><a href="javascript:void(0)" onclick="getczdata(\''+i+'\')">末页 &gt;&gt;</a></li>'+
                '</ul></div>';
            $('#page').html(pagebody);
            $('#czbody').html(str);

        }
    });
}


